<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
    <script src="../js/jquery-1.11.3.js"></script>
    <script src="../js/code.js"></script>
    <script src="../js/cookie.js"></script>

    <script src="../js/interface.js"></script>
    <link rel="stylesheet" href="../css/login.css">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_2836455_6ilkix860gg.css">

</head>

<body>
    <div class="header">
        <div class="left">
            <a href="./home.html"><img src="http://images.400976.cn/images/77/20210616232653_36101.png"></a>
            <a href="login.html"><span>快捷登录/</span></a>
            <a href="reg.html"><span>注册</span></a>
        </div>
        <div class="right">
            <i class="iconfont icon icon-zhengpinbaozhangxian"></i> 100%正品保障
            <i class="iconfont icon icon-013-baoyou"></i>全场满200包邮
            <i class="iconfont icon icon-shandianfahuo"></i>闪电发货

        </div>
    </div>
    <div class="my_shop"> <img src="https://ssl1.sephorastatic.cn/wcsfrontend/campaign/campaign_img/2021/09/live20210928/0928/live20210928_01.jpg" alt="">

    </div>
    <div class="broadside "><img src="https://www.chanel.cn/fnbv3/design-desktop/v_2021_09.1.0/img/account/fond-d.jpg" alt=""></div>

    <form class="box" onsubmit="return false">
        <div class="jd"> <img src="https://ssl1.sephorastatic.cn/wcsfrontend/campaign/campaign_img/2021/09/banner/hp_hairfloor_20210916.jpg" alt=""></div>
        <div class="login_zuo"> <img src="http://www.400976.cn/templates/site/pc/images/login-zuo.jpg" alt=""></div>
        <div class="login_you"> <img src="http://www.400976.cn/templates/site/pc/images/login-you.jpg" alt=""></div>
        <div class="box_a">
            <p>
                <label for=""></label>
                <input type="text" id="user" placeholder="用户名">
                <span id="user_span"></span>
            </p>
            <p>
                <label for=""></label>
                <input type="password" id="pwd" placeholder="密&emsp;码">
                <span id="pwd_span"></span>
            </p>
            <p>
                <label><input type="checkbox" id="isRem">  是否记住用户名?</label>
            </p>
            <p>
                <input id="regBtn" type="submit" value="登录">
                <input id="retBtn" type="reset" value="取消">
            </p>
        </div>
    </form>
    <div class="footer">
        <p>漂洋海淘 版权所有 渝ICP证100019号</p>
        <ul>
            <li>品牌导航</li>
            <li> 资讯导航</li>
            <li> 问答导航</li>
            <li>口碑导航</li>
            <li>价格表导航</li>
            <li>图片导航</li>
        </ul>
    </div>
</body>
<script>
    $("#regBtn").click(() => {
        $.ajax({
            type: "post",
            url: "../php/login.php",
            data: {
                user: $("#user").val(),
                pwd: $("#pwd").val()
            },
            dataType: "json"
        }).then(function(data) {

            console.log(data);



            if (data.status) {

                window.localStorage.setItem("user", $("#user").val())


                let backurl = window.localStorage.getItem("backurl");
                if (backurl) {
                    location.href = backurl

                }
                location.href = "goodslist.html"
            } else {
                // location.href = "list.html"
                alert("用户名不存在或密码错误")
            }


        })
    })
</script>
</script>


</html>